﻿using System;
using Ellanet.ViewModels;
using System.Windows;
using System.Windows.Input;
using Ellanet.Classes;

namespace Ellanet.Windows
{
    public partial class ResultsWindow
    {
        public ResultsWindow(int correctAnswers, TimeSpan totalTime, TimeSpan fastestAnswerTime, Sum fastestAnswer, TimeSpan slowestAnswerTime, Sum slowestAnswer)
        {
            InitializeComponent();
            DataContext = new ResultsWindowViewModel(correctAnswers, totalTime, fastestAnswerTime, fastestAnswer, slowestAnswerTime, slowestAnswer);
        }

        private void CloseButton_OnClick(object sender, RoutedEventArgs e)
        {
            Close();
        }

        private void ResultsWindow_OnMouseDown(object sender, MouseButtonEventArgs e)
        {
            if (e.ChangedButton == MouseButton.Left)
            {
                DragMove();
            }
        }
    }
}
